home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.6 KB | 45 lines | [TEXT/GEOL] |
- Item 1745294 23-Jan-91 14:57
-
- From: LSR@APPLE.COM@INTERNET# Gateway to Internet/BITNET/UUCP
-
- To: CPLUS.APPLE$ C++ Interest List--Apple Employees
-
- Item forwarded by BEISEL to WANG2
-
- Item forwarded by TIM.SWIHART to CPLUS.DEV$
-
- INTERNET# Document Id: <11824@goofy.Apple.COM>
-
- ------------------------------------------------------------------------------
-
- Sub: Re: RE>>const vs #define in C
-
- If you use AppleLink 6.0, you win! The Reply button works for gatewayed E-mail.
- Otherwise, copy & paste this: lsr@Apple.com@INTERNET#
-
- From: lsr@Apple.com (Larry Rosenstein)
- References: <2415334@AppleLink.Apple.COM>
- Lines: 14
- Organization: Apple Computer, Inc.
- Newsgroups: apple.lang.c++
- Path: apple!lsr
- Sender: usenet@Apple.COM
- To: cplus.apple$@applelink.apple.com
-
-
- In article <2415334@AppleLink.Apple.COM>, V0629@AppleLink.Apple.COM (New Engl
- and Digital,R & D,ASC,VAR) writes:
- >
- > This is very easy to explain. #define is not at all the same as const.
- > #define is a preprocessor directive causing a textual substitution BEFORE the
- > compiler scans the code. Therefore, #define symbols do not appear in the
- > symbol table.
-
- I think #define symbols do appear in the dump file, since when the dump
- file is loaded those symbols will end up being defined. You are right,
- however, that there is a difference between const ints and #defines.
- Certainly the compiler must save the full type information for a const int,
- while a #define is untyped. If the constant is a small number, then the
- textual representation will be smaller than its binary representation.
-
-